<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Hais丶定制 - 提交定制</title>
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
          rel="stylesheet">
    <link href="css/sb-admin-2.min.css" rel="stylesheet">
</head>

<body id="page-top">

<div id="wrapper">
    <div id="content-wrapper" class="d-flex flex-column">

        <!-- Main Content -->
        <div id="content">
            <div class="alert alert-primary" role="alert" id="message"> 目前仅支持安卓10、11、12的MIUI官方系统，出包为卡线二合一包,遇到不懂的请进群看公告教程.</div>
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary">定制选项</h6>
                </div>
                <div class="card-body">

                    <div class="form-row">
                        <div class="col-md-4 mb-3 form-group">
                            <label for="diyType">定制类型 <small>(小白请选常规定制，如需自定义请参考群共享内的定制模板)</small></label>
                            <select class="form-control" id="diyType" name="diyType" value="NORMAL" onchange="switchDiyType()">
                                <option value="NORMAL">选择功能定制(常规定制,小白推荐)</option>
                                <option value="CUSTOM_DEL">精简列表定制(专业模式)</option>
                                <option value="MIX_DEL">调整列表定制(对官网列表进行增删)</option>
                            </select>
                        </div>
                        <div class="col-md-4 mb-3 form-group">
                            <label for="delType">精简类型 <small>(MIUI经常换文件路径,扫描删除可根据文件名搜索进行删除)</small></label>
                            <select class="form-control" id="delType" name="delType" value="NORMAL">
                                <option value="NORMAL">普通精简(稳定,可能会删不干净,免费使用)</option>
                                <option value="SCAN_DEL">扫描删除(干净,可能会误删,消耗1次)</option>
                            </select>
                        </div>
                        <div class="col-md-4 mb-3 form-group">
                            <label for="money">插队制作<small>(如您急需可进行插队优先制作,会扣除相应的次数)</small></label>
                            <select class="form-control" id="money" name="money" value="0">
                                <option value="0">不进行插队</option>
                                <option value="2">2</option>
                                <option value="4">4</option>
                                <option value="6">6</option>
                                <option value="8">8</option>
                                <option value="10">10</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="col-md-6 mb-3">
                            <form class="needs-validation was-validated" action="post" id="xxxtemp">
                                <label for="romUrl">官包地址 <small>(如您不会提取直链 可<a href="https://xiaomirom.com/series/"
                                                                              target="_blank">点此处</a>进行提取)</small></label>
                                <input type="text" class="form-control" id="romUrl" name="romUrl"
                                       placeholder="请填卡刷包直链 http://xx.xx.com/miui_xxx.zip" required>
                                <div class="invalid-feedback">请填写正确的卡刷包直链,不会提取请看群公告</div>
                            </form>
                        </div>
                        <div class="col-md-6 mb-3">
                            <form class="needs-validation was-validated" action="post" id="uploadInfo">
                                <label for="diskToken">阿里云网盘Token</label>
                                <input type="hidden" value="aliyun" id="type" name="type">
                                <input type="text" class="form-control" id="diskToken" name="diskToken"
                                       placeholder="如不会提取请看群公告,有教程">
                                <div><small>如传Hais盘,可留空(不推荐传Hais盘)</small></div>
                            </form>
                        </div>
                    </div>

                    <form class="needs-validation was-validated" action="post" id="detailInfo">
                        <div class="form-row">
                            <div class="col-md-2 mb-3">
                                <label for="authorName">定制作者名</label>
                                <input type="text" class="form-control" id="authorName" name="authorName"
                                       placeholder="关于界面要展示的作者名字" value="Hais丶纯净版">
                            </div>
                            <div class="col-md-2 mb-3 form-group">
                                <label for="zipLevel">压缩等级(越大速度越慢)</label>
                                <select class="form-control" id="zipLevel" name="zipLevel" value="5">
                                    <option value="5">默认5</option>
                                    <option value="2">2</option>
                                    <option value="4">4</option>
                                    <option value="6">6</option>
                                    <option value="8">8</option>
                                    <option value="9">9(仅线刷)</option>
                                </select>
                            </div>
                            <div class="col-md-2 mb-3 form-group">
                                <label for="encryption">强制加密</label>
                                <select class="form-control" id="encryption" name="encryption" value="save">
                                    <option value="delete">去除</option>
                                    <option value="save">保留</option>
                                </select>
                            </div>
                            <div class="col-md-2 mb-3 form-group">
                                <label for="magisk">Magisk稳定版</label>
                                <select class="form-control" id="magisk" name="magisk" value="24.3">
                                    <option value="24.3">添加24.3</option>
                                    <option value="25.1">添加25.1</option>
                                    <option value="null">不添加</option>
                                </select>
                            </div>
                            <div class="col-md-2 mb-3 form-group">
                                <label for="hosts">Hosts去广告</label>
                                <select class="form-control" id="hosts" name="hosts" value="null">
                                    <option value="https://raw.githubusercontent.com/otobtc/ADhosts/master/hosts">ADHost</option>
                                    <option value="null">不添加</option>
                                </select>
                            </div>
                            <div class="col-md-2 mb-3 form-group">
                                <label for="seLinux">安全SeLinux</label>
                                <select class="form-control" id="seLinux" name="seLinux" value="open">
                                    <option value="open">保持开启</option>
                                    <option value="close">关闭</option>
                                </select>
                            </div>
                        </div>

                        <br>
                        <div class="customDelLayout">
                            <h5>精简列表</h5>
                            <hr/>
                            <div class="form-row">
                                <div class="col-md-12 mb-3">
                                <label for="customDelInfo">请输入精简列表</label>
                                <textarea class="form-control" id="customDelInfo" name="customDelInfo" rows="10"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="normalDelLayout">
                            <h5>精简选项</h5>
                            <hr/>
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelPrint"
                                               name="isDelPrint" checked>
                                        <label class="custom-control-label" for="isDelPrint">去除打印机服务</label>
                                        <div><small>删除打印机功能</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelWallpaper"
                                               name="isDelWallpaper">
                                        <label class="custom-control-label" for="isDelWallpaper">去除系统自带壁纸</label>
                                        <div><small>删除系统自带壁纸和壁纸选择器</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelAudio"
                                               name="isDelAudio" checked>
                                        <label class="custom-control-label" for="isDelAudio">去除铃声提示音</label>
                                        <div><small>去除一些不是默认的提示音</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelIcons"
                                               name="isDelIcons">
                                        <label class="custom-control-label" for="isDelIcons">去除主题完美图标</label>
                                        <div><small>使用第三方主题图标的可去除</small></div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelNFC"
                                               name="isDelNFC">
                                        <label class="custom-control-label" for="isDelNFC">去除NFC和钱包</label>
                                        <div><small>删除钱包NFC、智能卡等</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelCert"
                                               name="isDelCert">
                                        <label class="custom-control-label" for="isDelCert">去除证书管理</label>
                                        <div><small>删除证书管理、安装等相关</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelTouch"
                                               name="isDelTouch" checked>
                                        <label class="custom-control-label" for="isDelTouch">去除触摸助手</label>
                                        <div><small>去除小圆点触摸助手</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelPortal"
                                               name="isDelPortal" checked>
                                        <label class="custom-control-label" for="isDelPortal">去除传送门</label>
                                        <div><small>需同时保留自带浏览器才正常</small></div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelCit"
                                               name="isDelCit">
                                        <label class="custom-control-label" for="isDelCit">去除Cit工程模式</label>
                                        <div><small>删除后测试、工程模式将不可用</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelFrequent"
                                               name="isDelFrequent">
                                        <label class="custom-control-label" for="isDelFrequent">去除常用语</label>
                                        <div><small>删除常用语,自带输入法全面屏适配</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelYellowPage"
                                               name="isDelYellowPage">
                                        <label class="custom-control-label" for="isDelYellowPage">去除黄页</label>
                                        <div><small>去除后不可标记和识别来电号码</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelMacro"
                                               name="isDelMacro" checked>
                                        <label class="custom-control-label" for="isDelMacro">去除小米连招</label>
                                        <div><small>一般用不到,我也不知道在哪里</small></div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelOffAlarm"
                                               name="isDelOffAlarm" checked>
                                        <label class="custom-control-label" for="isDelOffAlarm">去除关机闹钟</label>
                                        <div><small>去除后关机闹钟不会响</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelSearchBox"
                                               name="isDelSearchBox" checked>
                                        <label class="custom-control-label" for="isDelSearchBox">去除上拉搜索框</label>
                                        <div><small>去除后需到桌面设置,设置上滑为无</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelStore"
                                               name="isDelStore" checked>
                                        <label class="custom-control-label" for="isDelStore">去除小米应用商店</label>
                                        <div><small>酷安不好么,为什么要用系统的。</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelBrowser"
                                               name="isDelBrowser" checked>
                                        <label class="custom-control-label" for="isDelBrowser">去除自带浏览器</label>
                                        <div><small>可能影响传送门使用</small></div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelGoogle"
                                               name="isDelGoogle" checked>
                                        <label class="custom-control-label" for="isDelGoogle">去除Google服务</label>
                                        <div><small>去不去除貌似都要刷模块才能用</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelAssistant"
                                               name="isDelAssistant" checked>
                                        <label class="custom-control-label" for="isDelAssistant">去除桌面负一屏</label>
                                        <div><small>需到桌面设置关闭智能助理(小部件好像跟这有关)</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelXiaoAi"
                                               name="isDelXiaoAi" checked>
                                        <label class="custom-control-label" for="isDelXiaoAi">去除小爱同学</label>
                                        <div><small>感觉挺智障的,唤醒又不灵敏,要他何用</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelMusic"
                                               name="isDelMusic" checked>
                                        <label class="custom-control-label" for="isDelMusic">去除自带小米音乐</label>
                                        <div><small>感觉压抑云好像好一些.</small></div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelVideo"
                                               name="isDelVideo" checked>
                                        <label class="custom-control-label" for="isDelVideo">去除自带小米视频</label>
                                        <div><small>群共享的EU本地版本好多了.</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelMiPlus"
                                               name="isDelMiPlus" checked>
                                        <label class="custom-control-label" for="isDelMiPlus">去除MIUI+</label>
                                        <div><small>去除MIUI+,多屏互动、互传</small></div>
                                    </div>
                                </div>
                                <div class="col-md-3 mb-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" id="isDelJoyose"
                                               name="isDelJoyose" checked>
                                        <label class="custom-control-label" for="isDelJoyose">去除MIUI云控</label>
                                        <div><small>也就是Joyose,看不懂的勾上就好</small></div>
                                    </div>
                                </div>
                            </div>
                        </div>


                        <div class="form-row">
                            <button class="btn btn-primary" type="button" id="postMake">提交定制</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>
        <footer class="sticky-footer bg-white">
            <div class="container my-auto">
                <div class="copyright text-center my-auto">
                    <span>Copyright © 2020-2021 hais.pw</span>
                </div>
            </div>
        </footer>
    </div>
</div>
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>

<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>

<!-- Custom scripts for all pages-->
<script src="js/sb-admin-2.min.js"></script>
<script>
    function loadMakeList(id) {
        $('#diyType').attr("disabled", '').removeAttr("checked");
        $('#delType').attr("disabled", '').removeAttr("checked");
        $('#money').attr("disabled", '').removeAttr("checked");
        $('#romUrl').attr("disabled", '').removeAttr("checked");
        $('#diskToken').attr("disabled", '').removeAttr("checked");
        $('#encryption').attr("disabled", '').removeAttr("checked");
        $('#hosts').attr("disabled", '').removeAttr("checked");
        $('#magisk').attr("disabled", '').removeAttr("checked");
        $('#seLinux').attr("disabled", '').removeAttr("checked");
        $('#authorName').attr("disabled", '').removeAttr("checked");
        $('#zipLevel').attr("disabled", '').removeAttr("checked");


        $('#isDelPrint').attr("disabled", '').removeAttr("checked");
        $('#isDelWallpaper').attr("disabled", '').removeAttr("checked");
        $('#isDelAudio').attr("disabled", '').removeAttr("checked");
        $('#isDelIcons').attr("disabled", '').removeAttr("checked");
        $('#isDelNFC').attr("disabled", '').removeAttr("checked");
        $('#isDelCert').attr("disabled", '').removeAttr("checked");
        $('#isDelTouch').attr("disabled", '').removeAttr("checked");
        $('#isDelPortal').attr("disabled", '').removeAttr("checked");
        $('#isDelCit').attr("disabled", '').removeAttr("checked");
        $('#isDelFrequent').attr("disabled", '').removeAttr("checked");
        $('#isDelYellowPage').attr("disabled", '').removeAttr("checked");
        $('#isDelMacro').attr("disabled", '').removeAttr("checked");
        $('#isDelOffAlarm').attr("disabled", '').removeAttr("checked");
        $('#isDelSearchBox').attr("disabled", '').removeAttr("checked");
        $('#isDelStore').attr("disabled", '').removeAttr("checked");
        $('#isDelBrowser').attr("disabled", '').removeAttr("checked");
        $('#isDelGoogle').attr("disabled", '').removeAttr("checked");
        $('#isDelAssistant').attr("disabled", '').removeAttr("checked");
        $('#isDelXiaoAi').attr("disabled", '').removeAttr("checked");
        $('#isDelMusic').attr("disabled", '').removeAttr("checked");
        $('#isDelVideo').attr("disabled", '').removeAttr("checked");
        $('#isDelMiPlus').attr("disabled", '').removeAttr("checked");
        $('#isDelJoyose').attr("disabled", '').removeAttr("checked");
        $('#postMake').attr("disabled", '').removeAttr("checked");
        $('#customDelInfo').attr("disabled", '').removeAttr("checked");

        $.ajax({
            type: "get",
            data: "random=" + Math.random(),
            url: "http://api.hais.pw/miui/make/get?id=" + id,
            dataType: "json",
            beforeSend: function (XMLHttpRequest) {
                XMLHttpRequest.setRequestHeader("Authorization", 'Bearer ' + localStorage.getItem("user_token"));
            },
            success: function (data) {
                console.log(data);
                var detailInfo = JSON.parse(data.detailInfo);
                var uploadInfo = JSON.parse(data.uploadInfo);

                $('#message').html("【<a target='_blank' href='http://wpa.qq.com/msgrd?v=3&amp;uin=" + data.userId + "&amp;site=qq&amp;menu=yes'>" + data.userId + "</a>】的定制"+data.message);
                $('#diyType').val(data.diyType);
                $('#delType').val(data.delType);
                $('#money').val(data.money);
                $('#romUrl').attr("value", data.romUrl);

                $('#diskType').val(uploadInfo.diskType);
                $('#authorName').attr("value", detailInfo.authorName);
                $('#zipLevel').val(detailInfo.zipLevel);
                $('#encryption').val(detailInfo.encryption);
                $('#magisk').val(detailInfo.magisk);
                $('#hosts').val(detailInfo.hosts);
                $('#seLinux').val(detailInfo.seLinux);

                switchDiyType()
                $('#customDelInfo').val(detailInfo.customDelInfo);

                if (detailInfo.isDelPrint) {
                    $('#isDelPrint').attr("checked", '');
                }
                if (detailInfo.isDelWallpaper) {
                    $('#isDelWallpaper').attr("checked", '');
                }
                if (detailInfo.isDelAudio) {
                    $('#isDelAudio').attr("checked", '');
                }
                if (detailInfo.isDelIcons) {
                    $('#isDelIcons').attr("checked", '');
                }
                if (detailInfo.isDelNFC) {
                    $('#isDelNFC').attr("checked", '');
                }
                if (detailInfo.isDelCert) {
                    $('#isDelCert').attr("checked", '');
                }
                if (detailInfo.isDelTouch) {
                    $('#isDelTouch').attr("checked", '');
                }
                if (detailInfo.isDelPortal) {
                    $('#isDelPortal').attr("checked", '');
                }
                if (detailInfo.isDelCit) {
                    $('#isDelCit').attr("checked", '');
                }
                if (detailInfo.isDelFrequent) {
                    $('#isDelFrequent').attr("checked", '');
                }
                if (detailInfo.isDelYellowPage) {
                    $('#isDelYellowPage').attr("checked", '');
                }
                if (detailInfo.isDelMacro) {
                    $('#isDelMacro').attr("checked", '');
                }
                if (detailInfo.isDelOffAlarm) {
                    $('#isDelOffAlarm').attr("checked", '');
                }
                if (detailInfo.isDelSearchBox) {
                    $('#isDelSearchBox').attr("checked", '');
                }
                if (detailInfo.isDelStore) {
                    $('#isDelStore').attr("checked", '');
                }
                if (detailInfo.isDelBrowser) {
                    $('#isDelBrowser').attr("checked", '');
                }
                if (detailInfo.isDelGoogle) {
                    $('#isDelGoogle').attr("checked", '');
                }
                if (detailInfo.isDelAssistant) {
                    $('#isDelAssistant').attr("checked", '');
                }
                if (detailInfo.isDelXiaoAi) {
                    $('#isDelXiaoAi').attr("checked", '');
                }
                if (detailInfo.isDelMusic) {
                    $('#isDelMusic').attr("checked", '');
                }
                if (detailInfo.isDelVideo) {
                    $('#isDelVideo').attr("checked", '');
                }
                if (detailInfo.isDelMiPlus) {
                    $('#isDelMiPlus').attr("checked", '');
                }
                if (detailInfo.isDelJoyose) {
                    $('#isDelJoyose').attr("checked", '');
                }
            },
            error: function (data) {

            }
        });

    }

    function switchDiyType() {

        if ($('#diyType').val() == 'CUSTOM_DEL') {
            $('.normalDelLayout').hide()
            $('.customDelLayout').show()
        } else if ($('#diyType').val() == 'MIX_DEL') {
            $('.normalDelLayout').show()
            $('.customDelLayout').show()
        }else{
            $('.normalDelLayout').show()
            $('.customDelLayout').hide()
        }
    }
    switchDiyType()

    $('#postMake').click(function () {
        if ($('#diyType').val() == 'CUSTOM_DEL') {
            $('#isDelPrint').attr("checked", '');
            $('#isDelWallpaper').attr("checked", '');
            $('#isDelAudio').attr("checked", '');
            $('#isDelIcons').attr("checked", '');
            $('#isDelNFC').attr("checked", '');
            $('#isDelCert').attr("checked", '');
            $('#isDelTouch').attr("checked", '');
            $('#isDelPortal').attr("checked", '');
            $('#isDelCit').attr("checked", '');
            $('#isDelFrequent').attr("checked", '');
            $('#isDelYellowPage').attr("checked", '');
            $('#isDelMacro').attr("checked", '');
            $('#isDelOffAlarm').attr("checked", '');
            $('#isDelSearchBox').attr("checked", '');
            $('#isDelStore').attr("checked", '');
            $('#isDelBrowser').attr("checked", '');
            $('#isDelGoogle').attr("checked", '');
            $('#isDelAssistant').attr("checked", '');
            $('#isDelXiaoAi').attr("checked", '');
            $('#isDelMusic').attr("checked", '');
            $('#isDelVideo').attr("checked", '');
            $('#isDelMiPlus').attr("checked", '');
            $('#isDelJoyose').attr("checked", '');
        } else if ($('#diyType').val() == 'NORMAL') {
            $('#customDelInfo').val("")
        }

        var data = {
            "romUrl": $('#romUrl').val(),
            "diyType": $('#diyType').val(),
            "delType": $('#delType').val(),
            "money": $('#money').val(),
            "detailInfo": $('#detailInfo').serializeObject(),
            "uploadInfo": $('#uploadInfo').serializeObject(),
        }

        $.ajax({
            type: "post",
            contentType: "application/json;charset=utf-8",
            data: JSON.stringify(data),
            dataType: "json",
            url: "http://api.hais.pw/miui/make/create-make",
            beforeSend: function (XMLHttpRequest) {
                XMLHttpRequest.setRequestHeader("Authorization", 'Bearer ' + localStorage.getItem("user_token"));
                $('#postMake').val('提交中..').attr('disabled', true);
            },
            success: function (data) {
                alert(data.message);
                console.log(data);
                loadMakeList(data.data.id)
            },
            error: function (data) {
                alert(JSON.parse(data.responseText).message);
            },
            complete: function () {
                $('#postMake').val('提交定制').attr('disabled', false);
            }
        });
    });

    $.fn.serializeObject = function () {
        var o = {};
        var a = this.serializeArray();
        $.each(a, function () {
            if (o[this.name]) {
                if (!o[this.name].push) {
                    o[this.name] = [o[this.name]];
                }
                o[this.name].push(this.value || '');
            } else {
                o[this.name] = this.value || '';
            }
        });
        return o;
    };

    var urlRequest = function (name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return decodeURIComponent(r[2]);
        } else {
            return null;
        }
    };
    var id = urlRequest('id');
    if (id || id.length != 0) {
        loadMakeList(urlRequest('id'));
    }
</script>

</body>

</html>
